#include "connect.h"
PGconn *conn = NULL;
PGconn * dbconnect(){
    if(conn == NULL){
		conn = PQconnectdb("dbname=fdb");
		if(PQstatus(conn) == CONNECTION_BAD){
			fprintf(stderr, "数据库连接失败，程序退出！\n");
			PQfinish(conn);
			exit(1);
		}
	}
	return conn;
}
